home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 139
/
(Vol 139) Sep 24 2011.iso
/
Games
/
theme_park_thriller.swf
/
scripts
/
frame_55
/
DoAction.as
Wrap
Text File
|
2011-09-24
|
2KB
|
60 lines
Map.attachMovie("player","Player",playerStartRow * 100 + playerDepth);
Map.Player._x = (playerStartColumn - 1) * tileWidth + tileHalf;
Map.Player._y = (playerStartRow - 1) * tileHeight + tileHalf;
Map.Player.currentRow = playerStartRow;
Map.Player.currentColumn = playerStartColumn;
Map.Player.speed = playerSpeed;
mascotsActive = [];
mascotIndex = 1;
var i = 1;
while(i <= numOfMascots)
{
spawnMascot();
i++;
}
centerMap();
Interface.gotoAndPlay("GetReady");
stop();
Interface.onEnterFrame = function()
{
this.bakersText = _root.bakersHelped + "/" + _root.numOfBakers;
};
Map.Player.onEnterFrame = function()
{
if(gameInPlay)
{
this.lastX = this._x;
this.lastY = this._y;
this.lastDir = this.currentDir;
this.currentRow = Math.ceil(this._y / tileHeight);
this.currentColumn = Math.ceil(this._x / tileWidth);
this.currentTile = whatNumber(this.currentColumn,this.currentRow);
if(Key.isDown(38))
{
this.currentDir = "Up";
moveClip(this);
}
else if(Key.isDown(40))
{
this.currentDir = "Down";
moveClip(this);
}
else if(Key.isDown(37))
{
this.currentDir = "Left";
moveClip(this);
}
else if(Key.isDown(39))
{
this.currentDir = "Right";
moveClip(this);
}
else
{
this.gotoAndStop("Idle");
}
}
centerMap(4);
this.swapDepths(this.currentRow * 1000 + playerDepth + this.currentColumn);
};